<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Alfar Engine: AlfarEngine.Components.Sprite Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Alfar Engine
   
   </div>
   <div id="projectbrief">A little 2D engine managing a scene</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespace_alfar_engine.html">AlfarEngine</a>      </li>
      <li class="navelem"><a class="el" href="namespace_alfar_engine_1_1_components.html">Components</a>      </li>
      <li class="navelem"><a class="el" href="class_alfar_engine_1_1_components_1_1_sprite.html">Sprite</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#properties">Properties</a>  </div>
  <div class="headertitle">
<div class="title">AlfarEngine.Components.Sprite Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="AlfarEngine::Components::Sprite" --><!-- doxytag: inherits="AlfarEngine::Components::AComponent" --><div class="dynheader">
Inheritance diagram for AlfarEngine.Components.Sprite:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_alfar_engine_1_1_components_1_1_sprite.png" usemap="#AlfarEngine.Components.Sprite_map" alt=""/>
  <map id="AlfarEngine.Components.Sprite_map" name="AlfarEngine.Components.Sprite_map">
<area href="class_alfar_engine_1_1_components_1_1_a_component.html" title="Abstract class that define a &quot;Component&quot;, a specification of an object." alt="AlfarEngine.Components.AComponent" shape="rect" coords="0,0,241,24"/>
<area href="class_alfar_engine_1_1_components_1_1_animated_sprite.html" alt="AlfarEngine.Components.AnimatedSprite" shape="rect" coords="0,112,241,136"/>
</map>
 </div></div>

<p><a href="class_alfar_engine_1_1_components_1_1_sprite-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1e20195da413692ae2e1cfedcc417857"></a><!-- doxytag: member="AlfarEngine::Components::Sprite::Sprite" ref="a1e20195da413692ae2e1cfedcc417857" args="(GameObject pOwner)" -->
&#160;</td><td class="memItemRight" valign="bottom"><b>Sprite</b> (<a class="el" href="class_alfar_engine_1_1_game_object.html">GameObject</a> pOwner)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_alfar_engine_1_1_components_1_1_sprite.html#a94a5c43c2b0f6d1af47f9eb6be972738">setTexture</a> (string pPath)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the texture to the designated <a class="el" href="class_alfar_engine_1_1_components_1_1_sprite.html">Sprite</a>.  <a href="#a94a5c43c2b0f6d1af47f9eb6be972738"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_alfar_engine_1_1_components_1_1_sprite.html#a88ae2d785285a71fcabf0f0861b8db11">setTexture</a> (<a class="el" href="class_alfar_engine_1_1_data_1_1_referenced_texture.html">ReferencedTexture</a> pTexture)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the texture to the given ReferencedTexture.  <a href="#a88ae2d785285a71fcabf0f0861b8db11"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a11672c064609a7952f71bb05b3a5ccb3"></a><!-- doxytag: member="AlfarEngine::Components::Sprite::Update" ref="a11672c064609a7952f71bb05b3a5ccb3" args="(Microsoft.Xna.Framework.GameTime pTime)" -->
override void&#160;</td><td class="memItemRight" valign="bottom"><b>Update</b> (Microsoft.Xna.Framework.GameTime pTime)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">override void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_alfar_engine_1_1_components_1_1_sprite.html#a466039b7ff2ef817ca1bf769e91252b1">Draw</a> (GameTime pTime, Color pColor)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Called when the engine Draw the component. Override to specify.  <a href="#a466039b7ff2ef817ca1bf769e91252b1"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af476181e85de85f3b1b96a4c11f7e75f"></a><!-- doxytag: member="AlfarEngine::Components::Sprite::mTexture" ref="af476181e85de85f3b1b96a4c11f7e75f" args="" -->
<a class="el" href="class_alfar_engine_1_1_data_1_1_referenced_texture.html">ReferencedTexture</a>&#160;</td><td class="memItemRight" valign="bottom"><b>mTexture</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2d06a783e99f3457f4b0277a2c3e059e"></a><!-- doxytag: member="AlfarEngine::Components::Sprite::mSourceRect" ref="a2d06a783e99f3457f4b0277a2c3e059e" args="" -->
Rectangle&#160;</td><td class="memItemRight" valign="bottom"><b>mSourceRect</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a83a91309c0d9439dd0cfb27514ca3cdf"></a><!-- doxytag: member="AlfarEngine::Components::Sprite::mOrigin" ref="a83a91309c0d9439dd0cfb27514ca3cdf" args="" -->
Vector2&#160;</td><td class="memItemRight" valign="bottom"><b>mOrigin</b></td></tr>
<tr><td colspan="2"><h2><a name="properties"></a>
Properties</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_alfar_engine_1_1_data_1_1_referenced_texture.html">ReferencedTexture</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_alfar_engine_1_1_components_1_1_sprite.html#a92fefa28f51b4cb8b47ed571d2c680de">texture</a><code> [get, set]</code></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the texture associated with this <a class="el" href="class_alfar_engine_1_1_components_1_1_sprite.html">Sprite</a>.  <a href="#a92fefa28f51b4cb8b47ed571d2c680de"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Rectangle&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_alfar_engine_1_1_components_1_1_sprite.html#a88ab9ccbadf509e518b4fdc53b3c8595">sourceRect</a><code> [get, set]</code></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the source rectange, meaning the part of the texture drawn. If it's "null", then the entire texture is drawn.  <a href="#a88ab9ccbadf509e518b4fdc53b3c8595"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Vector2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_alfar_engine_1_1_components_1_1_sprite.html#a2a976853e17aa32cdef1127fb0038d1e">center</a><code> [get]</code></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the center (in local coodinate) of this sprite.  <a href="#a2a976853e17aa32cdef1127fb0038d1e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Vector2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_alfar_engine_1_1_components_1_1_sprite.html#a0417fe807f769c43763ffff36b546670">origin</a><code> [get, set]</code></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the origin of the sprite in local coordinate. If null, mOrigin is set to the center of the sprite (if no sourceRect is set) or the center of sourceRect if set.  <a href="#a0417fe807f769c43763ffff36b546670"></a><br/></td></tr>
</table>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a466039b7ff2ef817ca1bf769e91252b1"></a><!-- doxytag: member="AlfarEngine::Components::Sprite::Draw" ref="a466039b7ff2ef817ca1bf769e91252b1" args="(GameTime pTime, Color pColor)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">override void AlfarEngine.Components.Sprite.Draw </td>
          <td>(</td>
          <td class="paramtype">GameTime&#160;</td>
          <td class="paramname"><em>pTime</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Color&#160;</td>
          <td class="paramname"><em>pColor</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Called when the engine Draw the component. Override to specify. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pTime</td><td></td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented from <a class="el" href="class_alfar_engine_1_1_components_1_1_a_component.html#aaa010d944163f806c6f5c2c6528a0646">AlfarEngine.Components.AComponent</a>.</p>

</div>
</div>
<a class="anchor" id="a94a5c43c2b0f6d1af47f9eb6be972738"></a><!-- doxytag: member="AlfarEngine::Components::Sprite::setTexture" ref="a94a5c43c2b0f6d1af47f9eb6be972738" args="(string pPath)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void AlfarEngine.Components.Sprite.setTexture </td>
          <td>(</td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"><em>pPath</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the texture to the designated <a class="el" href="class_alfar_engine_1_1_components_1_1_sprite.html">Sprite</a>. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pPath</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a88ae2d785285a71fcabf0f0861b8db11"></a><!-- doxytag: member="AlfarEngine::Components::Sprite::setTexture" ref="a88ae2d785285a71fcabf0f0861b8db11" args="(ReferencedTexture pTexture)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void AlfarEngine.Components.Sprite.setTexture </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_alfar_engine_1_1_data_1_1_referenced_texture.html">ReferencedTexture</a>&#160;</td>
          <td class="paramname"><em>pTexture</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the texture to the given ReferencedTexture. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pTexture</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Property Documentation</h2>
<a class="anchor" id="a2a976853e17aa32cdef1127fb0038d1e"></a><!-- doxytag: member="AlfarEngine::Components::Sprite::center" ref="a2a976853e17aa32cdef1127fb0038d1e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vector2 AlfarEngine.Components.Sprite.center<code> [get]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the center (in local coodinate) of this sprite. </p>

</div>
</div>
<a class="anchor" id="a0417fe807f769c43763ffff36b546670"></a><!-- doxytag: member="AlfarEngine::Components::Sprite::origin" ref="a0417fe807f769c43763ffff36b546670" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vector2 AlfarEngine.Components.Sprite.origin<code> [get, set]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the origin of the sprite in local coordinate. If null, mOrigin is set to the center of the sprite (if no sourceRect is set) or the center of sourceRect if set. </p>

</div>
</div>
<a class="anchor" id="a88ab9ccbadf509e518b4fdc53b3c8595"></a><!-- doxytag: member="AlfarEngine::Components::Sprite::sourceRect" ref="a88ab9ccbadf509e518b4fdc53b3c8595" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Rectangle AlfarEngine.Components.Sprite.sourceRect<code> [get, set]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the source rectange, meaning the part of the texture drawn. If it's "null", then the entire texture is drawn. </p>

</div>
</div>
<a class="anchor" id="a92fefa28f51b4cb8b47ed571d2c680de"></a><!-- doxytag: member="AlfarEngine::Components::Sprite::texture" ref="a92fefa28f51b4cb8b47ed571d2c680de" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_alfar_engine_1_1_data_1_1_referenced_texture.html">ReferencedTexture</a> AlfarEngine.Components.Sprite.texture<code> [get, set]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the texture associated with this <a class="el" href="class_alfar_engine_1_1_components_1_1_sprite.html">Sprite</a>. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>E:/XNA/alfarEngine/AlfarEngine/Components/Sprite.cs</li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Properties</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Mon Jan 16 2012 09:38:38 for Alfar Engine by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
